home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 16
/
016.d81
/
t.lk.conway's li
< prev
next >
Wrap
Text File
|
2022-08-26
|
5KB
|
287 lines
About Conway's Game of Life
===== ======== ==== == ====
written by: Joel Ellis Rea
for: COMAL Corner
This program is written as a COMAL
Kernal-compatible LIST file. That
means you must have either COMAL 0.14
on disk (available from Loadstar), or
COMAL 2.0 on cartridge (available from
Commodore or the COMAL User's Group,
USA). Since it is a LIST (SEQ) file,
it must be ENTERed, not LOADed, into
memory. Just type (while in COMAL
with this disk in the drive):
NEW _ REQUIRED for 0.14,
optional for 2.0!
ENTER"LK.CONWAY'S LIFE"
< Insert formatted disk now >
SAVE"C.CONWAY'S LIFE" _ 0.14, OR
SAVE"C2.CONWAY'S LIFE" _ 2.0.
From then on, you may LOAD and RUN
the program in a single step simply by
typing:
CHAIN"C.CONWAY'S LIFE" _ 0.14
- OR -
RUN"C2.CONWAY'S LIFE" _ 2.0
from the appropriate COMAL.
This program is an implementation
of a mathematical simulation invented
by mathematician John Conway. He
called it "LIFE", because by using 3
simple rules, he could simulate the
growth of colonies of hypothetical
single-celled organisms. These cells
are arranged in a rectangular (X-Y)
coordinate system (i.e. rows and col-
umns). The rules are:
#1. All births and deaths occur
simultaneously in a given
generation.
#2. A "live" cell with exactly
2 or 3 neighbors will survive
to the next generation. All
others will "die" (either from
isolation or overcrowding).
#3. An empty "cell" with exactly
3 neighbors will become a
"live" cell in the next gen-
eration.
That's it! A "neighbor" is defined
as a "live" cell adjacent to the cell
in question, either horizontally,
vertically or diagonally. Thus, each
cell may have from 0 to 8 neighbors!
From these simple rules and a sim-
ple starting pattern, very complex and
beautiful patterns may form over the
course of succeeding generations.
From a particular starting pattern,
one of the following may happen:
#1. The colony will eventually
die out completely
#2. The colony will stabilize
into a cycling pattern. The
cycle may have a period of 1,
and therefore not appear to
change at all, or may have a
very large period, in which
case a human might not notice
the cycling!
#3. The colony will change and
grow forever, never dying out
and never cycling (repeating).
No pattern has been found that
does this, but it has not been
proven mathematically impos-
sible!
If a pattern is asymmetrical, it
will tend to become symmetrical. Once
it becomes symmetrical, it can never
lose its symmetry. (Theoretically,
that is. In real "life" and this pro-
gram, the "world" has borders!)
When the program starts, you will
have a blank screen and a circular
"cursor" that you may move with the
arrow keys, or "A" for up, "Z" for
down, "<" for left and ">" for right.
Pressing SPACE will place a dot (live
cell) at that spot if empty, or re-
move a live cell. Press RETURN when
done entering your starting pattern
and the program will commence.
This program actually uses the text
screen and the color memory for work-
ing storage. There are no "arrays" in
memory keeping track of the cells and
their neighbors. The color of a given
cell reflects how many neighbors it
has. Thus, a RED cell has 2 neighbors
(RED = color 2), and thus will survive
to the next generation. At the begin-
ning of each generation, all cells are
set to BLACK (color 0).
The program does not actually count
how many neighbors each cell has. In-
stead, it takes each "live" cell, and
increments the color of each surround-
ing cell, thus exerting a "neighborly"
influence on the surrounding cells!
Here are some good starting pat-
terns to try:
**
** "R Pentomino"
*
R Pentomino comes quite close to ful-
filling result #3 -- infinite growth!
It has been observed to have a cycle
period well over 1000!
***
*
*
* "I-Beam"
*
*
***
I-Beams produce beautiful bi-symmetri-
cal patterns. These patterns vary ac-
cording to the height of the central
beam, and whether said beam has an odd
or even number of dots!
* *
* *
* *
* "Big X"
* *
* *
* *
Big X's produce lovely poly-symmetri-
cal patterns. These vary on the size
of the X, and whether the two "arms"
meet at one dot (as above), or four
(like this:
* *
**
**
* * )
Because this program is written in
COMAL, you cannot RUN it from the
LOADSTAR environment. The program is
on Side 2 of this issue. It is saved
under the name of LK.CONWAY'S LIFE.
=========== End of Article ===========